package com.fang.controller;

import com.fang.annotations.Limiting;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Fang Ruichuan
 * @date 2022-12-27 10:57
 */
@Slf4j
@RestController
public class IndexController {

    // 使用限流注解的接口1
    @GetMapping("/limit1")
    @Limiting(limitNum = 1, name = "limiting1")
    public String limit1() {
        return "limiting1";
    }

    // 使用限流注解的接口2
    @GetMapping("/limit2")
    @Limiting(limitNum = 2, name = "limiting2")
    public String limit2() {
        return "limiting2";
    }
}
